<% if current_user.subscribed_to? topic %>
  <%= button_to 'Unsubscribe', subscription_path(current_user.find_subscription(topic)), :method => :delete %>
<% else %>
  <% form_for :subscription, :url => subscriptions_path do |f| %>
    <%= f.hidden_field :topic_id, :value => @topic.id %>
    <%= f.hidden_field :user_id, :value => current_user.id %>
    <%= submit_tag 'Subscribe' %>
  <% end %>
<% end %>